<?php
class ListasComponent extends Component
{
	public function __construct() 
	{
		$this->Silo = ClassRegistry::init('Silo');
		$this->Rubro = ClassRegistry::init('Rubro');
		$this->Relacion = ClassRegistry::init('Relacion');
		$this->Forma = ClassRegistry::init('Forma');
		$this->Banco = ClassRegistry::init('Banco');
		
	}

	function lista_silo(){
		$codigo= $this->Silo->find('list',array('fields'=>'Silo.id, Silo.nombre','conditions'=>array('Silo.estatus'=>1)));
		return $codigo;
	}
	function lista_rubro(){
		$codigo= $this->Rubro->find('list',array('fields'=>'Rubro.id, Rubro.nombre','conditions'=>array('Rubro.estatus'=>1)));
		return $codigo;
	}
	function lista_relacion($estatus=array(1)){
		$codigo= $this->Relacion->find('list',array('fields'=>'Relacion.id, Relacion.numero','conditions'=>array('Relacion.estatus'=>$estatus),'order'=>'Relacion.id Desc'));
		return $codigo;
	}
	function lista_forma(){
		$codigo= $this->Forma->find('list',array('fields'=>'Forma.id, Forma.nombre','conditions'=>array('Forma.estatus'=>1,'Forma.id >'=>0)));
		$codigo[0]="NO APLICA";
		return $codigo;
	}
	function lista_bancos(){
		$codigo= $this->Banco->find('list',array('fields'=>'Banco.id, Banco.nombre','conditions'=>array('Banco.estatus'=>1,'Banco.id >'=>0)));
		$codigo[0]="NO APLICA";
		return $codigo;
	}
	function lista_estatus(){
		
		$codigo[-1]='ANULADA';
		$codigo[1]='PENDIENTE';
		$codigo[2]='CANCELADA';
		return $codigo;
	}

}
